import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'

import App from './App.vue'

import createStore from './store'
import createRouter from './router'

import './assets/styles/global.styl'

Vue.use(Vuex)
Vue.use(VueRouter)

const router = createRouter()
const store = createStore()
    // 全局守卫
router.beforeEach((to, from, next) => {
    // 校验 登陆
    console.info('beforeEach');
    next()
})

// 全局后置钩子
router.afterEach((to, from) => {
    console.info('afterEach');
})

new Vue({
    router,
    store,
    render: (h) => h(App)
}).$mount('#root')